package spring_cloud.demo.game_hystrix_2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

	@Autowired
	GameService gameService;
	
	@GetMapping("/startGame")
	public String start(@RequestParam(defaultValue="Player1") String userName,@RequestParam(defaultValue="") String password) {
		return gameService.conectToServer(userName, password);
	}
	
	@GetMapping("/startGame2")
	public String start2(@RequestParam(defaultValue="Player1") String userName,@RequestParam(defaultValue="") String password) {
		return gameService.conectToUnstableServer(userName, password);
	}

}
